use Test::More;
use GD::Graph::mixed;
require 'save.pl';

print STDERR "Processing sample65 (The error message is intended)\n";

my @data = ( 
    ["1st","2nd","3rd","4th","5th","6th","7th", "8th", "9th"],
    [    1,    2,    3,    4,    5,  6,   7,    8,    9],
);

my $my_graph = new GD::Graph::mixed(600,400);

$my_graph->set( 
    types => [ qw( lines ) ],
    default_type => 'points',
);

$my_graph->set( 

    x_label         => 'X Label',
    y_label         => 'Y label',
    title           => 'A Mixed Type Graph',

    y_max_value     => 10,
    y_min_value     => 0,
    y_tick_number   => 5,
    y_label_skip    => 1,
    x_plot_values   => 1,
    y_plot_values   => 1,

    long_ticks      => 1,
    x_ticks         => 0,

    legend_marker_width => 24,
    line_width      => 3,
    marker_size     => 5,


    transparent     => 0,
);

$my_graph->set_legend( qw( one two three four five six ) );
$my_graph->plot(\@data) or die $my_graph->error;

#note explain $my_graph;
my $x_zero = $my_graph->{left};         # abs zero point co-ord
my $x_step = $my_graph->{x_step};       # x step pixels
my $xp = $x_zero + $x_step * 5;      # the 5th data point abs x co-ord
my $t = $my_graph->{top};               # top abs y co-ord
my $b = $my_graph->{bottom};            # bottom abs y co-ord
my $mclr = $my_graph->{graph}->colorAllocate(255,0,0);
note $xp;
note $t;
note $b;
$my_graph->{graph}->dashedLine($xp, $t, $xp, $b, $mclr);
$xp = $x_zero + $x_step * 6;
$my_graph->{graph}->dashedLine($xp, $t, $xp, $b, $mclr);


save_chart($my_graph, 'sample65');
